module.exports = (app) => {
    const mongoose = app.mongoose;
    mongoose.pluralize(null);
    const Schema = mongoose.Schema;
    const shortUrlSchema = new Schema({
        //原始url
        url: {
            type: String,
            required: true
        },
        // 短id
        short_id: {
            type: String,
            required: true
        },
        // 访问次数
        visit_count: {
            type: Number,
            default: 0
        }
    }, { versionKey: false, timestamps: true })

    return mongoose.model('ShortUrl', shortUrlSchema)
}